#!usr/bin/env python
# -*- coding: utf-8 -*-
import frida, sys

def on_message(message, data):
    print(message)
    print(data)
    #print("[on_message] message:", message, "data:", data)
#processe#s = frida.get_remote_device().enumerate_processes()
#for process in processes:
#    print(process)
session = frida.get_remote_device().attach(2667)


jscode = """  
Java.perform(function() {
    var clazz = Java.use('com.bytedance.android.livesdk.gift.effect.entry.b.a');
    clazz.toString.implementation = function() {

        send(arguments); 

        return clazz.toString.apply(this, arguments);
    }
}); 
"""

script = session.create_script(jscode)

script.on("message", on_message)
script.load()
#sys.stdin.read()
